# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cpufreqd
pkgver=2.4.2
pkgrel=8
pkgdesc="A small daemon to adjust cpu speed (and indeed voltage)"
url="https://sourceforge.net/projects/cpufreqd/"
arch="all"
license="GPL-2.0-or-later"
subpackages="$pkgname-doc $pkgname-openrc"
makedepends="cpufrequtils-dev sysfsutils-dev"
source="https://downloads.sourceforge.net/cpufreqd/cpufreqd-$pkgver.tar.bz2
	cpufreqd.initd"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc
	make LIBS=-lpthread
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm 755 ../cpufreqd.initd "$pkgdir"/etc/init.d/cpufreqd
}

sha512sums="42067a28c1901cb2c45f21f918169648db77f553db1fbd44e2aae64e7092b530a1e3697a0cc4b4b70e0d474966671e924950501a0feb5d0ada166aa369dbc33b  cpufreqd-2.4.2.tar.bz2
cc5769f2f06ffeefe54ddde4d8829f8c1b9ddb82f32d883bf5df403c6386cac6ae8067cc7fa63c2b685b47bb88e6460b1f08bbf8ddf1c1fa392ecd6a17bea493  cpufreqd.initd"
